<div class="wrapper wrapper-content animated fadeInRight">
    <!-- PAGE CONTENT BEGINS -->
    <div class="row">


        <div class="col-xs-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>搜索</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">

                        <div class="table-responsive">
                            <form class="form-search" method="get" action="<?=url('company.company/index')?>"
                                  role="form">
                                <table>
                                    <tr>
                                        <td>商家全称:<input class="form-control" name="company_name" id="company_name"
                                                        value="<?=$search['company_name']?>" type="text"
                                                        placeholder="请输入商家全称" style=" width:200px"/></td>
                                        <td>联系人:<input class="form-control" name="name" id="name"
                                                       value="<?=$search['name']?>" type="text" placeholder="请输入联系人"
                                                       style=" width:200px"/></td>
                                        <td>电话:<input class="form-control" name="tel" id="tel"
                                                      value="<?=$search['tel']?>" type="text" placeholder="请输入电话"
                                                      style=" width:200px"/></td>

                                        <td>
                                            <div class="input-group">
                                                <button type="submit" style="margin-top: 42%"
                                                        class="btn form-control btn-sm btn-primary">
                                                    搜索
                                                </button>
                                            </div>
                                        </td>
                                    </tr>

                                </table>

                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="col-xs-12">
            <div class="ibox-content">
                <div class="row">
                    <div class="tableTools-container">
                        <a title="添加商家" href="<?=url('company.company/create')?>" class="btn btn-sm btn-success"><i class=" fa fa-plus"></i>添加商家</a>
                    </div>
                    <div class="table-responsive">
                        <table id="simple-table" class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>商家全称</th>
                                <th>LOGO</th>
                                <th>类型</th>
                                <th>分类</th>
                                <th>区域</th>
                                <th>联系人</th>
                                <th>电话</th>
                                <th>浏览数</th>
                                <th>电话数</th>
                                <th>预约数</th>
                                <th>点赞数</th>
                                <th>分享数</th>
                                <th>是否已审核</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <form id="mini_list">
                                <tbody>
                                <?php foreach($list as $val){ ?>
                                <tr>
                                    <td><?= $val->company_id ?></td>
                                    <td><?=$val->company_name?></td>
                                    <td><img width="50" src="/attachs/uploads/<?=$val->logo?>"/></td>
                                    <td><?=$val->type == 1 ? '个人' : '企业'?></td>
                                    <td><?=empty($cats[$val->cat_id]) ? '' : $cats[$val->cat_id]->cat_name?></td>
                                    <td><?=empty($areas[$val->area_id]) ? '' :$areas[$val->area_id]->area_name ?></td>
                                    <td><?=$val->name?></td>
                                    <td><?=$val->tel?></td>
                                    <td><?=$val->view_num?></td>
                                    <td><?=$val->tel_num?></td>
                                    <td><?=$val->yuyue_num?></td>
                                    <td><?=$val->zan_num?></td>
                                    <td><?=$val->share_num?></td>
                                    <td>
                                        <?php if($val->audit == 0) { ?>
                                        <span class="label label-warning">审核中</span>
                                        <?php }elseif($val->audit == 1) { ?>
                                        <span class="label label-success">审核通过</span>
                                        <?php }elseif($val->audit == 2) { ?>
                                        <span class="label label-danger">拒绝</span>
                                        <?php } ?>
                                    </td>
                                    <td><?=date("Y-m-d H:i:s",$val->add_time)?></td>
                                    <td>
                                        <div class="hidden-sm hidden-xs btn-group">
                                            <a title="编辑删除管理" href="<?=url('company.company/edit','company_id='.$val->company_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-edit bigger-120"></i>编辑</a>
                                            <a title="相册管理" mini="load" w="80%" h="80%" href="<?=url('company.company/photo','company_id='.$val->company_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-edit bigger-120"></i>相册管理</a>
                                            <a title="删除删除管理" mini="act" href="<?=url('company.company/delete','company_id='.$val->company_id)?>" class="btn btn-xs btn-warning"><i class="fa fa-trash bigger-120"></i>删除</a>
                                        </div>
                                    </td>
                                </tr>
                                <?php } ?>
                                </tbody>
                            </form>
                        </table>
                        <div>
                            <?php echo $page; ?>
                        </div>
                    </div><!-- /.row -->
                </div><!-- /.main-container -->
            </div>
        </div>
    </div>
</div>
